package tech.lq0.dreamaticvoyage.init;

import net.minecraft.client.gui.screens.MenuScreens;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import tech.lq0.dreamaticvoyage.block.entity.FukamizuPylonBlockEntity;
import tech.lq0.dreamaticvoyage.block.entity.UmisuPylonBlockEntity;
import tech.lq0.dreamaticvoyage.gui.menu.FukamizuPylonMenu;
import tech.lq0.dreamaticvoyage.gui.menu.UmisuPylonMenu;
import tech.lq0.dreamaticvoyage.gui.screen.*;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public class ScreenRegistry {

    @SubscribeEvent
    public static void onClientSetUpEvent(FMLClientSetupEvent event) {
        event.enqueueWork(() -> {
            MenuScreens.register(MenuTypeRegistry.FUKAMIZU_COMPRESSOR_MENU.get(), FukamizuCompressorScreen::new);
            MenuScreens.register(MenuTypeRegistry.PHANTASMAL_VOYAGER_MENU.get(), PhantasmalVoyagerScreen::new);
            MenuScreens.register(MenuTypeRegistry.CRYSTAL_POPPER_MENU.get(), CrystalPopperScreen::new);
            MenuScreens.register(MenuTypeRegistry.CRYSTAL_PURIFIER_MENU.get(), CrystalPurifierScreen::new);
            MenuScreens.register(MenuTypeRegistry.CRYSTAL_CUTTER_MENU.get(), CrystalCutterScreen::new);
            MenuScreens.register(MenuTypeRegistry.FUKAMIZU_CRUSHER_MENU.get(), FukamizuCrusherScreen::new);
            MenuScreens.register(MenuTypeRegistry.FUKAMIZU_BREAD_FURNACE_MENU.get(), FukamizuBreadFurnaceScreen::new);
            MenuScreens.register(MenuTypeRegistry.FUKAMIZU_PYLON_MENU.get(),
                    (MenuScreens.ScreenConstructor<FukamizuPylonMenu, AbstractContainerScreen<FukamizuPylonMenu>>) (menu, inventory, component) -> new PylonScreen<>(menu, inventory, component, FukamizuPylonBlockEntity.MAX_ENERGY));
            MenuScreens.register(MenuTypeRegistry.FUKAMIZU_REACTING_CHAMBER_MENU.get(), FukamizuReactionChamberScreen::new);
            MenuScreens.register(MenuTypeRegistry.FUKAMIZU_TURBINE_ENGINE_MENU.get(), FukamizuTurbineEngineScreen::new);
            MenuScreens.register(MenuTypeRegistry.UMISU_PYLON_MENU.get(),
                    (MenuScreens.ScreenConstructor<UmisuPylonMenu, AbstractContainerScreen<UmisuPylonMenu>>) (menu, inventory, component) -> new PylonScreen<>(menu, inventory, component, UmisuPylonBlockEntity.MAX_ENERGY));
            MenuScreens.register(MenuTypeRegistry.FUKAMIZU_PUNCH_MENU.get(), FukamizuPunchScreen::new);
            MenuScreens.register(MenuTypeRegistry.FUKAMIZU_FERMENTER_MENU.get(), FukamizuFermenterScreen::new);
            MenuScreens.register(MenuTypeRegistry.FUKAMIZU_EXTRACTION_MACHINE_MENU.get(), FukamizuExtractionMachineScreen::new);
            MenuScreens.register(MenuTypeRegistry.FUKAMIZU_BOOSTER_MENU.get(), FukamizuBoosterScreen::new);
        });
    }
}
